Customizing XML tags

Use the customization options in the XML Format dialog box when the report definition created by Crystal Reports doesn't provide the XML information you need. Customization can range from defining a few new XML element attributes to renaming elements and suppressing tags for fields you don't want to export data for.

When you choose Crystal ML Schema, you can carry out these tasks in the XML Format dialog box:

When you choose Custom Format, you can carry out these additional tasks:

Note:    You cannot add new report objects (tree nodes) while using the XML Format dialog box. If you want to create a new node, add a report object to your Crystal report, and it will be added to the Report Definition Tree.

To customize XML tags
  1. Open a report in Crystal Reports.
  2. On the Format menu, click XML Format.

    The XML Format dialog box appears with the report's definition tree displayed.

    Tip:    The XML Output Format Used box displays the format your report definition is using. Click the Options tab to select a different option.

  3. Expand the Report Definition Tree to find the report object whose XML tag you want to customize.

    Note:    

Changing XML tag names

This option applies only to report definitions that use Custom Format.

  1. Select a report object in the Report Definition Tree.
  2. In the XML Element Name box, type your changes to the XML element name.
  3. Click elsewhere in the Report Definition Tree to see the new element name.

When you export the report in XML format, the new tag name you assigned will be used.

Note:    Two or more report objects in the Report Definition Tree can be associated with the same XML element. Use the New button (next to the XML Element Name list) to create a new XML element for the selected report object.

To create a new XML element
  1. In the Report Definition Tree, select a report object that shares an XML element with another report object.

    The New button is activated.

  2. Click New and enter a new XML element name.
  3. Click elsewhere in the Report Definition Tree to see the new element name.
Adding XML attributes

This option applies to report definitions that use Crystal ML Schema or Custom Format.

  1. Select a report object in the Report Definition Tree.
  2. Click Create.

    The XML Attribute dialog box appears.

  3. In the Attribute Name box, enter a name for the attribute you are creating.

    Note:    Each attribute in an element must have a unique attribute name. Attribute names, however, don't have to be unique across elements.

  4. In the Attribute Type list, click the appropriate option for the attribute you're creating:
  5. In the Instance Value area, select Field or Text.

    Field lets you select a report field of the specified type as your instance value. The Field option is available only if the corresponding report object is not Report (root node) or an Area Pair type.

    Text lets you enter text in the associated box as an instance value for an element.

  6. In the Default Value box, enter a value if you want to assure the attribute is not left empty when there is no instance value.
  7. Click OK.

    The OK button is not available until an attribute name and instance or default value is entered.

You are returned to the XML Format dialog box. Your new attribute appears in the Attributes list.

Editing XML attributes

This option applies to report definitions that use Crystal ML Schema or Custom Format.

Note:    You can edit only those attributes you added using the XML Attribute dialog box.

  1. Select an element in the Report Definition Tree that has attributes.
  2. Select the attribute you want to edit in the XML Tag Attribute List and click Edit.

    Tip:    Attributes prefaced with the letters "ab" in blue are attributes you can edit. Those prefaced with "ab" in grey cannot be edited.

  3. Make your changes in the XML Attribute dialog box.
  4. Click OK to save changes.
Deleting XML attributes

This option applies to report definitions that use Crystal ML Schema or Custom Format.

Note:    You can delete only those attributes you added using the XML Attribute dialog box.

  1. Select an element in the Report Definition Tree that has attributes.
  2. Select the attribute you want to delete in the XML Tag Attribute List and click Delete.

    Tip:    Attributes prefaced with the letters "ab" in blue are attributes you can delete. Those prefaced with "ab" in grey cannot be deleted.

If you want to delete all attributes added using the XML Attribute dialog box for the selected element, click Delete All.

Suppressing XML tags

This option applies only to report definitions that use Custom Format.

  1. Select a report object in the Report Definition Tree.
  2. Select the Suppress XML Tag check box.

The selected report object won't be exported, and the associated XML element is not available for editing.

Note:    You can suppress all children of the selected report object by selecting the Suppress All Children check box.

To reverse this action, clear the Suppress XML Tag check box and/or the Suppress All Children check box.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com